package org.truenewx.tnxjee.web.security;

import java.util.List;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties("tnxjee.web.security")
public class WebSecurityProperties {

    private boolean csrfEnabled;
    private List<String> ignoringPatterns;
    private List<String> anonymousPatterns;
    /**
     * 没有权限注解的处理方法是否允许匿名访问，默认为false。
     * 注意：设置为true会带来安全隐患，忘记配置权限注解的处理方法将可匿名访问
     */
    private boolean anonymousWithoutAnnotation;

    public boolean isCsrfEnabled() {
        return this.csrfEnabled;
    }

    public void setCsrfEnabled(boolean csrfEnabled) {
        this.csrfEnabled = csrfEnabled;
    }

    public List<String> getIgnoringPatterns() {
        return this.ignoringPatterns;
    }

    public void setIgnoringPatterns(List<String> ignoringPatterns) {
        this.ignoringPatterns = ignoringPatterns;
    }

    public List<String> getAnonymousPatterns() {
        return this.anonymousPatterns;
    }

    public void setAnonymousPatterns(List<String> anonymousPatterns) {
        this.anonymousPatterns = anonymousPatterns;
    }

    public boolean isAnonymousWithoutAnnotation() {
        return this.anonymousWithoutAnnotation;
    }

    public void setAnonymousWithoutAnnotation(boolean anonymousWithoutAnnotation) {
        this.anonymousWithoutAnnotation = anonymousWithoutAnnotation;
    }

}
